<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li class="completed" v-for="(item,index) in arr" :key='index' >
      <div class="view">

        <input class="toggle" type="checkbox" />

        <label>{{item.title}}</label>

        <button @click="delbtn(item.id)" class="destroy"></button>
      </div>
    </li>
  </ul>

</template>

<script>
import axios from 'axios'
export default {
  props: ['arr'],
  methods: {
    async  delbtn (id) {
      await axios({
        url: '/list/' + id,
        method: 'DELETE'

      })
    }

  }

}
</script>
